/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistencia;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author hellen
 */
@Entity
@Table(name = "PAIS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pais.findAll", query = "SELECT p FROM Pais p"),
    @NamedQuery(name = "Pais.findByPaisID", query = "SELECT p FROM Pais p WHERE p.paisID = :paisID"),
    @NamedQuery(name = "Pais.findByPaisNombre", query = "SELECT p FROM Pais p WHERE p.paisNombre = :paisNombre"),
    @NamedQuery(name = "Pais.findByPaisCodArea", query = "SELECT p FROM Pais p WHERE p.paisCodArea = :paisCodArea")})
public class Pais implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "PaisID")
    private Integer paisID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "Pais_Nombre")
    private String paisNombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "Pais_CodArea")
    private String paisCodArea;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "empPaisID")
    private List<Empleado> empleadoList;

    public Pais() {
    }

    public Pais(Integer paisID) {
        this.paisID = paisID;
    }

    public Pais(Integer paisID, String paisNombre, String paisCodArea) {
        this.paisID = paisID;
        this.paisNombre = paisNombre;
        this.paisCodArea = paisCodArea;
    }

    public Integer getPaisID() {
        return paisID;
    }

    public void setPaisID(Integer paisID) {
        this.paisID = paisID;
    }

    public String getPaisNombre() {
        return paisNombre;
    }

    public void setPaisNombre(String paisNombre) {
        this.paisNombre = paisNombre;
    }

    public String getPaisCodArea() {
        return paisCodArea;
    }

    public void setPaisCodArea(String paisCodArea) {
        this.paisCodArea = paisCodArea;
    }

    @XmlTransient
    public List<Empleado> getEmpleadoList() {
        return empleadoList;
    }

    public void setEmpleadoList(List<Empleado> empleadoList) {
        this.empleadoList = empleadoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paisID != null ? paisID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pais)) {
            return false;
        }
        Pais other = (Pais) object;
        if ((this.paisID == null && other.paisID != null) || (this.paisID != null && !this.paisID.equals(other.paisID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistencia.Pais[ paisID=" + paisID + " ]";
    }
    
}
